package midi;

public class MidiSound {
	private Pitch pitch;
	private int velocity;
	
	public MidiSound(Pitch pitch, int velocity){
		this.pitch = pitch;
		this.velocity = velocity;
	}
	
	public MidiSound(int noteNumber, int velocity){
		this.pitch = new Pitch(noteNumber);
		this.velocity = velocity;
	}
	
	public MidiSound(String noteName, int velocity){
		this.pitch = new Pitch(noteName);
		this.velocity = velocity;
	}
	
	
	public Pitch getPitch(){
		return pitch;
	}
	
	public void setPitch(Pitch pitch){
		this.pitch = pitch;
	}
	
	public int getNoteNumber(){
		return pitch.getNoteNumber();
	}
	
	public String getNoteName(){
		return pitch.getNoteName();
	}
	
	public void setNoteNumber(int noteNumber){
		this.pitch.setNoteNumber(noteNumber);
	}
	
	public int getVelocity(){
		return velocity;
	}
	
	public void setVelocity(int velocity){
		this.velocity = velocity;
	}
	
	
	public boolean equals(Object obj){
		if (obj instanceof MidiSound){
			MidiSound comp = (MidiSound) obj;
			
			return (comp.pitch == this.pitch);
		}
		
		return false;
	}
	
}
